import xlrd

data = xlrd.open_workbook('302.xlsx')
table = data.sheet_by_name('进项发票信息')
table2 = data.sheet_by_name('销项发票信息')
table3 = data.sheet_by_name('企业信息')

code = 0
jine = 6
stat = 7
date = 2
danwei = 3

def getPingji(x):
    pingji=table3.cell(x,2).value
    code=table3.cell(x,0).value
    return (code,pingji)

def getIsCujin(x):
    if table3.cell(x,3).value==1:
        return True
    else:
        return False

def getCell(x,y,isJin):
    if isJin:
        return table.cell(x, y).value
    else:
        return table2.cell(x, y).value

def getStat(x,isJin):
    if isJin:
        t=table
    else:
        t=table2

    if t.cell(x, stat).value=='作废发票':
        return False
    else:
        return True
